// xc_lshop/shop/pack/mycard/com/qrcode.js
// import drawQrcode from '../../../utils/weapp-qrcode.js';
import drawQrcode from '../../../../../utils/weapp-qrcode.js';

Component({
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    show:false
  },
  created(){
    // this.init("111")
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onClose(){
    this.setData({
      show:false
    })
    },
    init(ordernum){
       this.setData({
         show:true
       })
       var that=this
      //  setTimeout(function() {
      //    console.log("oooo")
        that.createqrcode(ordernum);

      // }, 3000);

    },
    createqrcode(ordernum){
      console.log("ordernum")
     
      console.log(ordernum)
      // var ctx=wx.Canvas('canvasId', component)('myQrcode', this)
    // var code="";
    if(ordernum){
      drawQrcode({
        width: 120,
        height: 120,
        canvasId: 'myQrcode',
        text: ordernum,
        _this:this,
        callback(e){
            console.log(e)
        }
      })
    }
      
    },
  }
})
